from django.db import models


# 部门表
class Departtment(models.Model):
    name=models.CharField(max_length=32,unique=True)
    status=models.BooleanField(default=False)
    addtime=models.DateTimeField(auto_now_add=True)


    class Meta:
        db_table='depat'


# 员工表
class Staff(models.Model):
    username=models.CharField(max_length=32,unique=True)
    password=models.CharField(max_length=225)
    dept = models.ForeignKey('Departtment', on_delete=models.CASCADE)

    class Meta:
        db_table='staff'